import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components'
const Home = resolve => require(['@/components/home'], resolve);
const Download = resolve => require(['@/components/download'], resolve);
const Guide = resolve => require(['@/components/guide/index.vue'], resolve);
const Student = resolve => require(['@/components/guide/Student.vue'], resolve);
const Teachers = resolve => require(['@/components/guide/Teachers.vue'], resolve);
const Setup = resolve => require(['@/components/guide/Setup.vue'], resolve);
const Question = resolve => require(['@/components/guide/Question.vue'], resolve);

const Service=resolve => require(['@/components/service'], resolve);
const Private = resolve => require(['@/components/service/Private.vue'], resolve);
const Disclaimer = resolve => require(['@/components/service/Disclaimer.vue'], resolve);
const Wap = resolve => require(['@/components/wap'], resolve);


Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [{
    path: '/',
    name: 'index',
    component: Index,
    redirect: {
      name: 'home'
    },
    children: [{
        path: 'home',
        name: 'home',
        component: Home,
      },
      {
        path: 'download',
        name: 'download',
        component: Download,
      },
      {
        path: 'guide',
        name: 'guide',
        component: Guide,
        redirect: {
          name: 'student'
        },
        children: [{
            name: 'student',
            path: 'student',
            component: Student,
          },
          {
            path: 'teachers',
            name: 'teachers',
            component: Teachers
          },
          {
            path: 'setup',
            name: 'setup',
            component: Setup
          },
          {
            path: 'question',
            name: 'question',
            component: Question
          }
        ]
      },
      {
        path:'service',
        name:'service',
        component: Service,
        redirect:{
          name:'private'
        },
        children:[
          {
            path: 'private',
            name: 'private',
            component: Private
          },
          {
            path: 'disclaimer',
            name: 'disclaimer',
            component: Disclaimer
          }
        ]
      }
     
    ]
  },{
    path:'/wap',
    name:'wap',
    component:Wap
  }]
})
